<div class="indexWidth">
    <button type="button" class="btn btn-info mainButtonRight"><a
            href="javascript:takeout.openMenu('${ctxPath!}/dbtable/list?categoryid=${categoryid!}', null)" class="mianAcolor">返回</a></button>
    <div class="sectionTitle">
        数据库管理
        <hr>
    </div>
    <form id="dbtableForm" action="${ctxPath!}/dbtable/save" method="POST" class="form-horizontal"
          enctype="multipart/form-data">
        <input type="hidden" name="dbtable.id" value="${dbtable.id!}"/>
        <input type="hidden" name="dbtable.jdbcdriver" value="${dbtable.jdbcdriver!}"/>

        <div class="articleFormLabel">
            <label class="mainSetConsistentWidth">选择类别：</label>
            <#dictTag val="${dbtable.category!}" type="select" style="margin-left:5px;" group="dbtable"  pname="dbtable.category" defaultNumber="0"></#dictTag>
        </div>
        <div class="articleFormLabel">
            <label class="mainSetConsistentWidth">小程序名：</label>
            <input type="text" name="dbtable.title" class="mainSetWidth" value="${dbtable.title!}" placeholder="" valid="vtext" validname="小程序名 "/>
        </div>
        <div class="articleFormLabel">
            <label class="mainSetConsistentWidth">数据库名：</label>
            <input type="text" name="dbtable.tablename" class="mainSetWidth" value="${dbtable.tablename!}"
                   placeholder=""/>
        </div>

        <div class="articleFormLabel">
            <label class="mainSetConsistentWidth">数据库url：</label>
            <input type="text" name="dbtable.jdbcurl" class="mainSetWidth" value="${dbtable.jdbcurl!}" valid="vtext" validname="数据库url"
                   placeholder=""/>
        </div>
        <div class="articleFormLabel">
            <label class="mainSetConsistentWidth">数据库用户名：</label>
            <input type="text" name="dbtable.jdbcusername" class="mainSetWidth" value="${dbtable.jdbcusername!}" valid="vtext" validname="数据库用户名"
                   placeholder=""/>
        </div>

        <div class="articleFormLabel">
            <label class="mainSetConsistentWidth">数据库密码：</label>
            <input type="text" name="dbtable.jdbcpassword" class="mainSetWidth" value="${dbtable.jdbcpassword!}" valid="vtext" validname="数据库密码"
                   placeholder=""/>
        </div>
        <div class="articleFormLabel">
            <label class="mainSetConsistentWidth">分享次数：</label>
            <input type="text" name="dbtable.sharecount" class="mainSetWidth" value="${dbtable.sharecount!}"
                   placeholder=""/>
        </div>
        <div class="articleFormLabel">
            <label class="mainSetConsistentWidth">二维码页面：</label>
            <input type="text" name="dbtable.qrcodepage" class="mainSetWidth" value="${dbtable.qrcodepage!}"
                   placeholder=""/>
        </div>
        <div class="articleFormLabel">
            <label class="mainSetConsistentWidth">影视更新模版ID：</label>
            <input type="text" name="dbtable.videotemplateid" class="mainSetWidth" value="${dbtable.videotemplateid!}"
                   placeholder=""/>
        </div>

        <div class="form-group">
            <button style="margin-left: 100px;width:95px;" class="btn btn-info articleFormButton" type="button"
                    onclick="oper.save()">保存
            </button>
        </div>

    </form>

    <script type="text/javascript">
        var oper = {
            save:function(){
                if(!validForm()) {
                    return false;
                }
                takeout.ajaxFormMainPanel('dbtableForm')
                return true;
            }
        };

    </script>
    <script type="text/javascript">
        // 初始化Web Uploader


        function display(id) {
            var traget = document.getElementById(id);
            if (traget.style.display == "none") {
                traget.style.display = "";
            } else {
                traget.style.display = "none";
            }
        }

        function displayByName(name) {
            var traget = document.getElementsByName(name);
            if (traget.style.display == "none") {
                traget.style.display = "";
            } else {
                traget.style.display = "none";
            }
        }

        window.onload=function myalert(){
            alert("绑定成功！");
        }

        jQuery(function () {
//            alert("绑定成功！");
        });

        $(document).ready(function () {
            $("#smallapptype").change(function () {
//根据index获取选中项的value值
                var val = $(this).children('option:selected').val();
                if (val == 56) {
                    document.getElementById("tabb").style.display="none";
                    document.getElementById("tabb1").style.display="inline";
                } else {
                    document.getElementById("tabb1").style.display="none";
                    document.getElementById("tabb").style.display="inline";
                }
            });
//            oneToManyTag还没有执行完成
            var val = $("#smallapptype").children('option:selected').val();
//            alert("绑定成功！");
            if (val == 56) {
                document.getElementById("tabb").style.display="none";
                document.getElementById("tabb1").style.display="inline";
            } else {
                document.getElementById("tabb").style.display="inline";
                document.getElementById("tabb1").style.display="none";
            }
        });

    </script>